#ifndef _SHADER_MANAGER_H_
#define _SHADER_MANAGER_H_
#include "PCH.h"
#include "DeShader.h"
#include "ShaderBindingState.h"
#include "DeShaderType.h"

#define DECLEAR_SHADER_TYPE(ShaderClass, ShaderMetaClassElement)\
	public:\
	typedef De#ShaderMetaClassElement#ShaderType ShaderMetaType;\
	static ShaderMetaType m_StaticShaderType;\

#define IMPLEMENT_SHADER_TYPE(ShaderClass, ShaderFileName, ShaderFunctionName)\
	ShaderClass::ShaderMetaType ShaderClass::StaticType()

namespace DeviousRenderer
{
class ShaderManager
{
public:
	ShaderManager(ID3D11Device* d3dDevice, ID3D11DeviceContext* d3dDeviceContext);
	virtual ~ShaderManager();

	int		LoadShader(ShaderType type, std::wstring& fileName, std::wstring& mainFunction, const D3D_SHADER_MACRO* pDefines);
	void	BindShaders();
	void	UpdateShaderResources();

protected:
	DeShader*	GetShader(ShaderType shaderType);
protected:
	std::vector<DeShader*>	m_vShaders;
	ShaderBindingState*		m_ShaderBindingStates[SHADER_TYPE_NUM];

	ID3D11Device*			m_pDeviceRef;
	ID3D11DeviceContext*	m_pDeviceContextRef;


};

}
#endif//_SHADER_MANAGER_H_